﻿using FluentNHibernate.Mapping;
using Romantics.Domain.Objects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Romantics.Domain.Mappings
{
    class CountryMap : ClassMap<Country>
    {
        public CountryMap()
        {
            Id(x => x.ID);

            Map(x => x.Name)
                .Length(100)
                .Not.Nullable();

            Map(x => x.URL)
                .Length(100)
                .Not.Nullable();

            HasMany(x => x.Regions)
                .Inverse()
                .KeyColumn("COUNTRY_ID");
        }
    }
}
